<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
<script type="text/javascript" src="/bsc/static/js/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/css/bootstrap.css" media="all">
</head>
<body>
   </div>
    	<div class="container">
    <form class="form-horizontal" role="form" id="f1">
    <input type="text" name="phone" value="${user.phone }" id="phone">
   <div class="form-group">
    <label for="account" class="col-sm-2 control-label">帐户:</label>
    <div class="col-sm-10">
      <input type="text" class="form-control"  value="${user.account }" id="account" name="account" disabled="disabled" style="width: 500px;" >
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="button" class="btn btn-default" id="bc">提交</button>
       <button type="button" class="btn btn-default" onclick="op()">返回</button>
    </div>
  </div>
</form>
    </div>   
   <script type="text/javascript">
   $(function(){
	   //两次密码判断
	   $("#pad").blur(function(){
	 	   	if($("#password").val()==$("#pad").val()){
	 	   		$("#sp2").html("<font color='red'>密码正确</font>");
	 	   	}else{
	 	   	$("#sp2").html("<font color='red'>密码错误</font>");
	 	   	}
	 	});
	   //点击提交
	   $("#bc").click(function(){
	 		 if($("#password").val()==null||$("#pad").val()==null||$("#password").val()==""||$("#pad").val()==""){
	 			 alert("不能为空")
	 		 }else{
	 			 $.ajax({
	             	type:"post",
	             	url:"/bsc/shop/uppas",
	             	data:{"id":"${user.shop_user_id}","password":$("#pad").val()},
	             	success:function(msg){
	             		if(msg!=null){
	             			     alert("修改成功")
								 $("#password").val("");
	             			    $("#pad").val("");
	             			   $("#sp2").html("");
							}
	             	}
	             });  	 
	 		 }
	 	 	
	 	});
   });
   function op(){
		  document.forms[0].action="/bsc/shop/revert";
		  document.forms[0].submit();
	  }
   </script>   
      
      
</body>
</html>